/**
 * Created by Administrator on 2022/8/30.
 */
//抽象类
abstract class Animal {
    public String name;
    public int age;

    Animal(String name,int age){
        this.name = name;
        this.age = age;
    }
    abstract public void bark();//抽象方法
}
class Dog extends Animal {
    Dog(String name,int age) {
        super(name,age);
    }
    public void bark() {
        System.out.println(name+age+"汪汪");
    }
}
class Cat extends Animal {
    Cat(String name,int age) {
        super(name,age);
    }
    public void bark() {
        System.out.println(name+age+"喵喵");
    }
}
public class Test {
    public static void Tmp(Animal animal) {
        animal.bark();
    }
    public static void main(String[] args) {
        Tmp(new Dog("阿黄",1));
        Tmp(new Cat("阿鸣",2));
    }
}
